﻿/*
 * @author: wizardc
 */

using Dou.Utils;
using UnityEngine;

namespace Demo.WorldMap.Prefab
{
    public enum PrefabResState
    {
        None,
        Loading,
        Complete,
        Dispose
    }
    
    /// <summary>
    /// 单个预制信息对象
    /// </summary>
    public class PrefabResInfo : ICacheable
    {
        public int nodeIndex;
        public int resId;
        public Bounds bounds;
        public Matrix4x4 matrix;

        public PrefabResState state;
        public GameObject go;
        
        public void OnRecycle()
        {
            nodeIndex = 0;
            resId = 0;
            matrix = Matrix4x4.identity;
            state = PrefabResState.Dispose;
            go = null;
        }

        public void OnReuse()
        {
            state = PrefabResState.None;
        }
    }
}
